package phonebook;

import com.andro.chansung.R;

import android.app.ActionBar;
import android.app.Activity;
import android.app.ActionBar.Tab;
import android.os.Bundle;

public class PhoneBookActivity extends Activity {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.phone_book_main_layout);
		
		ActionBar actionBar = getActionBar();
		actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
		actionBar.setDisplayShowHomeEnabled(false);
		actionBar.setDisplayShowTitleEnabled(false);
		
		Tab tab = actionBar.newTab()
						   .setText("대학\n본부")
						   .setTabListener(new TabListener<PhoneUnivHeadquarterFragment>(this, 
										   											   	"head", 
										   											   	PhoneUnivHeadquarterFragment.class));
		actionBar.addTab(tab);
		
		tab 		= actionBar.newTab()
				   .setText("단과\n대학")
				   .setTabListener(new TabListener<PhoneUnivDepartmentsFragment>(this, 
								   											   	"department", 
								   											   	PhoneUnivDepartmentsFragment.class));
		actionBar.addTab(tab);
		
		tab 		= actionBar.newTab()
				   .setText("대학원")
				   .setTabListener(new TabListener<PhoneUnivGraduateSchoolFragment>(this, 
								   											   	"department", 
								   											   	 PhoneUnivGraduateSchoolFragment.class));
		actionBar.addTab(tab);
		
		tab 		= actionBar.newTab()
				   .setText("부속\n기관")
				   .setTabListener(new TabListener<PhoneUnivInstituteFragment>(this, 
								   											 "institute", 
								   											 PhoneUnivInstituteFragment.class));
		actionBar.addTab(tab);

		tab 		= actionBar.newTab()
				   .setText("부설\n기관")
				   .setTabListener(new TabListener<PhoneUnivAffiliationFragment>(this, 
								   											 "affiliation", 
								   											 PhoneUnivAffiliationFragment.class));
		actionBar.addTab(tab);
		
		tab 		= actionBar.newTab()
				   .setText("부설\n연구소")
				   .setTabListener(new TabListener<PhoneUnivAffiliationRDFragment>(this, 
									   											 "institute", 
									   										     PhoneUnivAffiliationRDFragment.class));
		actionBar.addTab(tab);
		
		tab 		= actionBar.newTab()
				   .setText("학생\n기구")
				   .setTabListener(new TabListener<PhoneUnivStudentOrgFragment>(this, 
								   											 "institute", 
								   											 PhoneUnivStudentOrgFragment.class));
		actionBar.addTab(tab);
		
		tab 		= actionBar.newTab()
				   .setText("기타")
				   .setTabListener(new TabListener<PhoneUnivETCFragment>(this, 
								   										"institute", 
								   										PhoneUnivETCFragment.class));
		actionBar.addTab(tab);
	}
}
